import { getCate } from '@/api/goods'
const state = {
  cates: []
}

const mutations = {
  SET_CATE(state, payload) {
    state.cates = payload
    console.log(state.cates)
  }
}

const actions = {
  ASYNC_CATE({ commit }) {
    getCate().then(res => {
      commit('SET_CATE', res.data)
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
